package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.dto.DataDTO;
import edu.ynu.se.xiecheng.achitectureclass.service.AirTemperatureService;
import edu.ynu.se.xiecheng.achitectureclass.service.CO2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/AirTemperature")
public class AirTemperatureController {

    @Autowired
    private AirTemperatureService airTemperatureService;

    @GetMapping("/tenAirTemperaturedata")
    public List<DataDTO> getAirTemperatureData() {
        return airTemperatureService.findLatestTenAirTemperatureData();
    }

}
